/*
 * Copyright (c) 2018. czmc All Rights Reserved.
 * Author: czmc
 * Email: zxc6355533@163.com
 * Encoding: UTF-8
 */

package top.stime21.myneighbours.module.login

import io.reactivex.Observable
import top.stime21.framework.mvp.MvpContract
import top.stime21.myneighbours.data.dto.BaseResult
import top.stime21.myneighbours.data.dto.NeedDetailsResult
import top.stime21.myneighbours.data.dto.NeedResult
import top.stime21.myneighbours.data.entity.Need

/**
 * Author: czmc  Email: @tuwan21.com
 * Version:	1.0  Date:3/3/2018
 */
interface NeedContract : MvpContract {

    interface View : MvpContract.View {
        /**
         * 发布成功
         */
         fun onPublishSuccess()

        /**
         * 接受成功
         */
        fun onAcceptSuccess()
        /**
         * 接受成功
         */
        fun onFinishSuccess()
        /**
         * 取消成功
         */
        fun onCancleSuccess()

        /**
         * 发布成功
         */
        fun onNearbySuccess(data:List<Need>?)

        /**
         * 获取成功
         */
        fun onMyNeedGetSuccess(data:List<Need>?)
        /**
         * 获取成功
         */
        fun onMyNeedMoreGetSuccess(data:List<Need>?)

        /**
         * 搜索成功
         */
        fun onSearchSuccess(data:List<Need>?)

        /**
         * 获取详情成功
         */
        fun onDetailsGetSuccess(data:Need?)
    }

    interface Presenter : MvpContract.Presenter {
        /**
         *  发布
         */
        fun publish(type:Int,address:String,lat:Double,lon:Double,content:String,title:String)
        /**
         * 接受
         */
        fun accept(id: Long)
        /**
         * 取消
         */
        fun cancel(id: Long)
        /**
         * 接受
         */
        fun finish(id: Long)
        /**
         * 附近
         */
        fun nearby(lat: Double, lon: Double)

        /**
         * 搜索
         */
        fun search(key: String)
        /**
         * 我的记录
         */
        fun myneed(type:Int)
        /**
         * 我的记录-更多
         */
        fun myneedMore(type:Int)

        fun details(id:Long)
    }

    interface Model : MvpContract.Model {
        /**
         *  发布
         */
        fun publish(type:Int,uid:Long,address:String,lat:Double,lon:Double,content:String,title:String): Observable<BaseResult>
        /**
         * 接受
         */
        fun accept(id: Long, uid: Long): Observable<BaseResult>
        /**
         * 完成
         */
        fun finish(id: Long, uid: Long): Observable<BaseResult>
        /**
         * 取消
         */
        fun cancel(id: Long, uid: Long,type:Int): Observable<BaseResult>
        /**
         * 附近
         */
        fun nearby(lat: Double, lon: Double,limit:Int): Observable<NeedResult>

        /**
         * 搜索
         */
        fun search(key: String): Observable<NeedResult>

        /**
         * 搜索
         */
        fun myneed(uid: Long,type:Int,page:Int,limit:Int): Observable<NeedResult>
        /**
         * 详情
         */
        fun details(id: Long): Observable<NeedDetailsResult>
    }
}
